package pta;/**
 * @author： li
 * @date： 2022-03-29 17:45
 * @version 1.0
 */
import java.io.*;
import java.util.Arrays;

public class N个数求和 {
    static BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
    static long gcd(long x, long y)
    {
        if (y>0)
        return gcd(y, x%y);
        else
        return x;
    }
    public static void main(String[] args) throws IOException {
        int n =Integer.parseInt(in.readLine());
        String[] a =in.readLine().split("[/| ]");
        long[] fz = new long[n];
        long[] fm = new long[n];
        for(int i=0,j=0;i<n;i++,j=j+2){
            fz[i]= Long.parseLong(a[j]);
            fm[i]= Long.parseLong(a[j+1]);
        }
        long max=1;
        for(int i=0;i<n;i++){
            max*=fm[i];
        }
        long sum =0;
        for(int i=0;i<n;i++){
            fz[i]*= (double)(max /fm[i]);
            sum+=fz[i];
        }
        long gy = gcd(Math.abs(sum),max);
        long zx = (sum/max);
        long rez =((sum-zx*max)/gy);
        long rem =(max/gy);
        if(n>0){
        if(zx==0&&rez!=0){
            if(rez*rem<0) {
            System.out.println("-"+Math.abs(rez)+"/"+Math.abs(rem));}
            else
                System.out.println(Math.abs(rez)+"/"+Math.abs(rem));
        }
        if(zx==0&&rez==0)
            System.out.println(zx);
        if(zx!=0&&rez==0)
            System.out.println(zx);
        if(zx!=0&&rez!=0) {
            if(rez*rem<0) {
            System.out.println("-"+Math.abs(zx)+" "+"-"+Math.abs(rez)+"/"+Math.abs(rem));}
            else
            System.out.println(Math.abs(zx)+" "+Math.abs(rez)+"/"+Math.abs(rem));
        }
        }else
            System.out.println(0);
    }
}
